Attribute VB_Name = "Module1"
Option Explicit
Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As _
Long) As Long
Private Const WS_EX_APPWINDOW = &H40000
Private Const GWL_EXSTYLE = (-20)

Sub Main()
    On Error GoTo ErrExit
    
    ' Activate the API
    Dim oSCAPI As New SCAPI.Application
    
    ' Init the form
    frmMain.Init oSCAPI
    
    ' Do this to activate the form icon on the taskbar or systray
    ' ShowInTaskBar for the form should be false
    Dim FormStyles As Long
    FormStyles = GetWindowLong(frmMain.hwnd, GWL_EXSTYLE)
    FormStyles = FormStyles Or WS_EX_APPWINDOW
    Call SetWindowLong(frmMain.hwnd, GWL_EXSTYLE, FormStyles)
    
    ' Show the form
    frmMain.Show 1
    
    Exit Sub
' Error exit
ErrExit:
    MsgBox "Failed to create SCAPI instance"

End Sub
